package org.halk.repository;

import org.halk.entity.UserTest;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

/**
 * @Author halk
 * @Date 2023/7/31 21:36
 */
public interface UserTestRepository extends JpaRepository<UserTest, Integer> {


    @Modifying
    @Query(value = "update user_test set age =1 where id = :id", nativeQuery = true)
    void update(String id);

    @Modifying
    @Query(value = "update user_test set name = :name where id = :id", nativeQuery = true)
    void updateName(String id, String name);

}
